<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="howl.model.Model" %>
<%@ page import="java.util.List" %>
<%@ page import="howl.types.HowlUser" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="java.util.Date" %>
<%
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
List<HowlUser> results = null;
HowlUser CurrentUser = null;
if(user == null){
	response.sendRedirect("/Welcome.jsp");
} else {

	CurrentUser = Model.getHowlUserfromUser(user);

	
	
	if(CurrentUser == null){
		response.sendRedirect("/Signup.jsp");
	}
	
	if(CurrentUser.isFirstTimeUser()){
		response.sendRedirect("/Auth/firsttimeuser.jsp");
	}
	
}
if(CurrentUser != null){
	
	CurrentUser.setLastloggedin(new Date());
}
%>
